import java.util.TooManyListenersException;
import java.util.regex.Pattern;

import com.sindice.SindiceException;

public class LiveQueryTest {

	static Pattern pattern = Pattern.compile("(<[^<>]*)(<)([^<>]*)>");
	
	public static void main(String[] args) throws SindiceException, TooManyListenersException {
		String value = "foo\"\" bar"; 
				System.out.println(value.replace("\"", "\\\"")
				.replaceAll("[^(\\x20-\\x7F)]", "?"));
//		String triple = "<http://dbpedia.org/page/A_Most_Unusual_Camera> <http://www.w3.org/1999/xhtml/vocab#alternate> <http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=DESCRIBE+<http://dbpedia.org/resource/A_Most_Unusual_Camera> . ";
//		Matcher matcher = pattern.matcher(triple);
//		if(matcher.find()) {
//			String foo = matcher.replaceAll("$1%3C$3%3E>");
//			System.out.println(foo);
//		}
		
//		LiveQuery liveQuery = new LiveQuery();
//		String uri = "http://api.sindice.com/v3/cache?url=http%3A%2F%2Fwordnet.rkbexplorer.com%2Fid%2Fword-Galway";
////		JSONObject json = liveQuery
////				.performQuery("http://dbpedia.org/resource/Genetic_algorithm");
//		System.out.println(liveQuery.performQuery("http%3A%2F%2Fwordnet.rkbexplorer.com%2Fid%2Fword-Galway"));
//		
//		System.out.println(Query.performGETQueryAndParseResult(uri).toString());
		
	}
}
